package com.sc.design.resposibilitychain;

import java.util.ArrayList;
import java.util.Random;

/**
 * @author sc
 * Created on  2017/12/6
 */
public class Client {
    public static void main(String[] args) {
        Random random = new Random();
        ArrayList<IWomen> arrayList = new ArrayList<>();
        for (int i=0;i<5;i++){
            arrayList.add(new Women("逛街",random.nextInt(4)));
        }

        Handler father = new Father();
        Handler son = new Son();
        Handler husband = new Husband();
        father.setNextHandler(husband);
        husband.setNextHandler(son);

        for(IWomen women:arrayList){
            father.HandlerMessage(women);
        }
    }
}
